Pages.FindByPageID method (Publisher) | 您所在的位置:网站首页 › how to rearrange pages in microsoft publisher › Pages.FindByPageID method (Publisher) |
Pages.FindByPageID method (Publisher)
Article
09/13/2021
2 minutes to read
Returns a Page object that represents the page with the specified page ID number. Each page is automatically assigned a unique ID number when it is created. Use the PageID property to return a page's ID number. Syntaxexpression.FindByPageID (PageID) expression A variable that represents a Pages object. Parameters Name Required/Optional Data type Description PageID Required Long Specifies the ID number of the page that you want to return. Publisher assigns this number when the page is created. Return valuePage RemarksUnlike the PageIndex property, the PageID property of a Page object won't change when you add pages to or rearrange pages in the publication. Therefore, using the FindByPageID method with the page ID number can be a more reliable way to return a specific Page object from a Pages collection than using the Item method with the page's index number. ExampleThis example demonstrates how to retrieve the unique ID number for a Page object, and then use this number to return that Page object from the Pages collection and add a new shape to the page. Sub FindPage() Dim lngPageID As Long 'Get page ID lngPageID = ActiveDocument.Pages.Add(Count:=1, After:=1).PageID 'Use page ID to add a new shape to the page ActiveDocument.Pages.FindByPageID(PageID:=lngPageID) _ .Shapes.AddShape Type:=msoShape5pointStar, _ Left:=200, Top:=72, Width:=50, Height:=50 End Sub Support and feedbackHave questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. |
CopyRight 2018-2019 实验室设备网 版权所有 |